package net.game.server.util.crypto;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SHA512 {
    
    public static byte[] encode(byte[] data) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-512");
            return md.digest(data);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return null;
    }
    
    public static String encode(String s) {
        return new String(encode(s.getBytes()));
    } 
}
